package edu.chl.grupp11.aegas.view;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;

import org.swixml.SwingEngine;

import edu.chl.grupp11.aegas.model.AbstractConfig;
import edu.chl.grupp11.aegas.model.ConfigFactory;

public class AboutBox implements ActionListener {
	private JButton aboutOkButton;
	private JFrame aboutFrame;
	private JLabel aboutLabel;
	private AbstractConfig config = ConfigFactory.getSharedConfig();

	public AboutBox() throws Exception {
		SwingEngine se = new SwingEngine(this);
		se.render("edu/chl/grupp11/aegas/view/xml/AboutView.xml").setVisible(
				true);
		aboutOkButton.addActionListener(this);

		aboutLabel.setText(config.getResourceBundle().getString("about_text"));
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		if (e.getSource() == aboutOkButton) {
			aboutFrame.setVisible(false);
		}
	}
}
